<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}
	$return['item']=$this->plugin_setting('basic');
	$return['item']['apiurl']=SITEROOT.'addons/jy_appsign/api.php?i='.$_SESSION['uniacid'].'&url=XXXXXXX&appopenid=xxx&timestamp=xxx&sign=xxx';
	$return['item']['secret']=$return['item']['secret']?:random(30);
	$this->plugin_setting('basic',$return['item']);
	$htmls=array(
		'type'=>'look',
		'desc'=>'参数设置',
		'look'=>array(
			array('type'=>'tip','title'=>'url格式：base64_encode加密，支持长链接，也支持短链接；appopenid就是第三方APP会员的唯一ID；sign签名由函数get_sign($_GET,$secret);生成；'),
			array('type'=>'copy','title'=>'免签登录地址示例','name'=>'apiurl'),
			array('type'=>'copy','title'=>'免签密钥','name'=>'secret','help'=>'用于加密签名使用！'),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
